import pygame
import random
from constants import SCREEN_HEIGHT, SCREEN_WIDTH


class Block(pygame.sprite.Sprite):
    def __init__(self):
        super().__init__()
        self.image = pygame.Surface((50, random.randint(50, 150)))
        self.image.fill((random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)))
        self.rect = self.image.get_rect()
        self.rect.left = SCREEN_WIDTH
        self.rect.bottom = SCREEN_HEIGHT
        self.speed = 3

    def update(self):
        self.rect.left -= self.speed


# 创建敌人
enemies = pygame.sprite.Group()